package com.the_ring.structural.composite;

/**
 * @author: t22306139
 * @date: 2023/12/1  10:32
 */
public class MainTest {

    public static void main(String[] args) {
        Composite c0 = new Composite();
        Component leaf1 = new Leaf("1");
        c0.add(leaf1);

        Composite c1 = new Composite();
        c0.add(c1);
        Component leaf2 = new Leaf("2");
        Component leaf3 = new Leaf("3");
        c1.add(leaf2);
        c1.add(leaf3);

        c0.operation();
    }
}
